#include "gameobj.hh"

GameObj::GameObj (int id, Vector3f pos, Vector3f size, unsigned hp_max, int playerid)
  : Object (id, pos, size, playerid)
  , hp_ (hp_max)
  , hp_max_ (hp_max)
{
}

GameObj::~GameObj ()
{}

bool
GameObj::loose_hp (unsigned damage)
{
  if (damage >= hp_)
    return true;
  else
    hp_ -= damage;

  return false;
}

void
GameObj::gain_hp (unsigned amount)
{
  hp_ += amount;
  if (hp_ > hp_max_)
    hp_ = hp_max_;
}
